package app.qrcode.browser.hearttoheart.adapters

import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ItemDecoration


/**
 * Created by DomenCai on 2022/3/25.
 */
class LinearSpacingItemDecoration(spacings: Int) :
    ItemDecoration() {
     private val space: Int = spacings

    override fun getItemOffsets(
        outRect: Rect,
        view: View,
        parent: RecyclerView,
        state: RecyclerView.State
    ) {
        super.getItemOffsets(outRect, view, parent, state)
        outRect.top = space//item上边的间距
        outRect.left = space/3//左边间距
        outRect.right = space/3//右边间距
        outRect.bottom = space //设置bottom padding
    }

}